package com.sanbi.erp.db.util;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 校验工具包
 */
public class StringUtil {
    public static boolean isEmpty(Integer Id) {
        return Id == null || Id == 0;
    }

    public static boolean isEmptyString(CharSequence cs) {
        return cs == null || cs.length() == 0 || cs.equals("");
    }

    public static boolean isEmptyMarket(BigDecimal bigDecimal) {
        return bigDecimal == null || bigDecimal.intValue() <= 0.00;
    }

    /**
     * 校验商品重量
     * @param bigDecimal
     * @return
     */
    public static boolean isWeightPrice(BigDecimal bigDecimal){
        return bigDecimal == null;
    }
    /**
     * 校验商品长宽高
     * @param number
     * @return
     */
    public static boolean isGoodsInfo(Integer number){
        return number == null;
    }

    /**
     * 时间校验 yyyy-MM-dd HH:mm:ss
     * @param dateTime
     * @return
     */
    public static boolean isEmptyTime(LocalDateTime dateTime) {
        return dateTime == null;
    }
}
